import React, { Component } from 'react'
import logo from '../../logo.svg'

type Props = {
  x: number,
  y: number
}

export default class Image extends Component<Props> {
  /*   state = {
    x: 0,
    y: 0,
  }
  move = (e: MouseEvent) => {
    this.setState({
      x: e.pageX,
      y: e.pageY,
    })
  }
  componentDidMount(): void {
    document.addEventListener('mousemove', this.move)
  }
  componentWillUnmount(): void {
    document.removeEventListener('mousemove', this.move)
  } */
  render() {
    const { x, y } = this.props
    return (
      <div>
        <img
          src={logo}
          width="100"
          height="100"
          alt=""
          style={{
            position: 'absolute',
            left: x,
            top: y,
          }}
        />
      </div>
    )
  }
}
